AEProcessAppleEvent
EventRecord * theEventRecord ; the high-level event record handler in your application for a specified Apple event.
After receiving a high-level event (and optionally checking whether it is a
type of high-level event other than an Apple event that your application might
function to determine the type of Apple event received and to call the
corresponding handler routine.
handler dispatch table for an entry that was installed with the constant
keyPreDispatch. If the application's special handler dispatch table does not
include such a handler or if the handler returns errAEEventNotHandled, the
function looks in the application's Apple event dispatch table for an entry that
matches the event class and event ID of the specified Apple event.
If the system special handler dispatch table does not include such a handler,
the server application and, if the client application is waiting for a reply, to
the client application.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
BufferIsSmall (-607) Buffer is too small
noOutstandingHLE (-608) No outstanding high-level event
errAECorruptData (-1702) Data in an Apple event could not be read
errAENewerVersion (-1706) Need a newer version of the
errAENotAppleEvent (-1707) Event is not an Apple event
errAEEventNotHandled (-1708) Event wasn't handled by an Apple event handler
Notes: If an Apple dispatch table contains one entry for an event class and a
specific event ID, and also contains another entry that is identical except
that it specifies a wildcard value for either the event class or the event ID,
example, if an Apple event dispatch table includes one entry that specifies
the event class as kAECoreSuite and the event ID as kAEDelete, and another
entry that specifies the event class as kAECoreSuite and the event ID as
handler associated with the entry which specifies the event ID as kAEDelete.